﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Pay.aspx.cs" Inherits="MopsesPetShop.Pay" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="DefaultContent">
        <div runat="server" id="contentMainDiv" class="contentMainDiv">
            <div runat="server" id="miniTitle" class="miniTitle">
            </div>
            <asp:Menu runat="server" ID="myMenu" CssClass="mainMenu" Orientation="Horizontal">
                <StaticMenuStyle CssClass="menuitem" />
                <DynamicMenuStyle CssClass="menuitem" />
                <StaticSelectedStyle CssClass="menuitemActive" />
                <DynamicSelectedStyle CssClass="menuitemActive" />
            </asp:Menu>
        </div>
       <%-- <div style="clear: both">
        </div>--%>
        <div class="allPayDiv" id="allPayDiv" runat="server">
            <div>
                Сумма с учётом доставки:
            </div>
            <div id="tom1">
                <%= StartSumm() %>
            </div>
        </div>
        <asp:Button Text="Оплатить" runat="server"></asp:Button>
    </div>
    <script language="javascript" type="text/javascript">
        function PlusClick(nameCost, nameCount, namePay) {
            var tmp = document.getElementsByName(nameCount)[0];
            var n = tmp.value - 0;
            tmp.value = n + 1;
            var cost = document.getElementsByName(nameCost)[0];
            var pay = document.getElementsByName(namePay)[0];
            var c = cost.value - 0;
            var p = pay.value - 0;
            pay.value = c * tmp.value;


            var div1 = document.getElementById("tom1");
            var sss = div1.innerHTML - 0;
            sss += c;
            div1.innerHTML = sss;
            return false;
        }
        function MinusClick(nameCost, nameCount, namePay) {
            var tmp = document.getElementsByName(nameCount)[0];
            var n = tmp.value - 0;
            var cost = document.getElementsByName(nameCost)[0];
            var pay = document.getElementsByName(namePay)[0];
            var c = cost.value - 0;
            var p = pay.value - 0;
            if (n > 0) {
                var div1 = document.getElementById("tom1");
                var sss = div1.innerHTML - 0;
                sss -= c;
                div1.innerHTML = sss;

                tmp.value = n - 1;
            }

            pay.value = c * tmp.value;
            return false;
        }
    </script>
</asp:Content>
